![]() |
PBHCreateAsync |
||||
Header: | Files.h | Carbon status: | Supported | |
Creates a new file.
OSErr PBHCreateAsync ( HParmBlkPtr paramBlock );
A pointer to a basic HFS parameter block.
A result code.
The relevant fields of the parameter block are:
On input, a pointer to a completion function.
On output, the result code of the function.
On input, a pointer to a pathname.
On input, a volume specification.
On input, a directory ID.
The PBHCreateAsync function creates a new file (both forks); the new file is unlocked and empty. The date and time of its creation and last modification are set to the current date and time. If the file created isn’t temporary (that is, if it will exist after the user quits the application), the application should call PBHSetFInfoAsync (after PBHCreateAsync) to fill in the information needed by the Finder.
Files created using PBHCreateAsync are not automatically opened. If you want to write data to the new file, you must first open the file using a file access function (such as PBHOpenDFAsync).
The resource fork of the new file exists but is empty. You’ll need to call one of the Resource Manager procedures CreateResFile, HCreateResFile, or FSpCreateResFile to create a resource map in the file before you can open it (by calling one of the Resource Manager functions OpenResFile, HOpenResFile, or FSpOpenResFile).
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)